<%@page language="java" contentType="text/html; charset=UTF-8" %>
<%@page import="btsm.bean.sqlCableWork,btsm.bean.dbConnector,btsm.bean.cablePage,java.sql.*"%>
<%!ResultSet rs;%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%
        cablePage mypage = new cablePage("ocableuinfo", "");
		
		String strbsSign = request.getParameter("bsSign");
		String strFilter = request.getParameter("txtFilter");
		String strUTF8Filter = "";
		if(strFilter == null || strFilter.equals("null"))
			strFilter = "";
		else
			strUTF8Filter = new String(strFilter.getBytes("ISO8859-1"), "UTF-8");	

		String stroccode = (String) request.getParameter("txtoccode");
        String strocname = (String) request.getParameter("txtocname");		
		String strsnid = (String) request.getParameter("snid");
		if(strsnid == null || strsnid.equals("null"))
			strsnid = "";
		
        strocname = new String(strocname.getBytes("ISO8859-1"), "utf-8");	
%>
<%
            String jspName = request.getRequestURI();
            jspName = jspName.substring(jspName.lastIndexOf("/") + 1);
			String strToPage = request.getParameter("ToPage");
%>
<%String titlename="纤芯使用状况";%>
<HTML>
<HEAD>
    <TITLE>新建光缆</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=UTF-8">
    <LINK href="Admin_Style.css" type=text/css rel=stylesheet>

</HEAD>

<BODY style="margin:2; overflow:hidden">

<script language="javascript" src="jscheck.js">
</script>
<script>
    <!--
    function tst(obj0,obj1,obj2){
        obj0.style.border="1 "+obj1+" solid";
        obj0.style.background=obj2;
    }
    //-->
	function btnReturn(){
	     document.frmReturn.submit();
	}	
</script>
<script>
	function btnRinsertS(){
		document.Jz_myform.seraction.value="serinsertsimple";
		document.Jz_myform.submit();
	}
	function btnModifyU(){
		document.Jz_myform.seraction.value="sermod";
		document.Jz_myform.submit();
	}
</script>
<SCRIPT LANGUAGE="JavaScript">
    <!--
    function textCounter(field, maxlimit) {
        if (field.value.length > maxlimit)
            field.value = field.value.substring(0, maxlimit);
    }
    //-->
</SCRIPT>
<SCRIPT>
    function tjsj(x){
        document.Jz_myform.snid.value=x;
		document.Jz_myform.seraction.value="serdel";
        if(confirm('确认要删除流水号为'+x+'的记录吗？'))
        	document.Jz_myform.submit();     
    }

    function tjsjx(x){
        document.Jz_myform.snid.value=x;
		document.Jz_myform.seraction.value="sermodp";
        document.Jz_myform.submit();
    }
</SCRIPT>
<script>
function genQuery(){
	frmQuery.bsSign.value = "1";
    frmQuery.submit();
}
</script>

<TABLE cellSpacing="0" align="center" cellPadding="0" width="100%" border=0>
    <TBODY>

<!--*********搜索工具条开始*****************-->		
<FORM name="frmQuery" action="nnmd_cableUInfo.jsp" method="post">


            <TR class=tdbg onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" align=middle>
                <TD width="1157" colspan="13"><input type="hidden" name="occode" id="occode" value="<%=stroccode%>"><p><input type="hidden" name="bsSign" value="0">  查  询： <input type="text" name="txtFilter" size="20" style="width: 159; height: 20" class=text2d onBlur="checkQuote(this.value,this)" onKeyDown="if(event.keyCode==13){genQuery()};" value="<%=strUTF8Filter%>">&nbsp;&nbsp;&nbsp;
                        <input type="button" value=" 搜索 " name="btnQuery" style="width: 40; height: 20" class=tx_button onClick="genQuery()" onMouseOver="tst(this,'blue','#ffffff')" onMouseOut="tst(this,'black','#e8e7fe')">
                   &nbsp;&nbsp;&nbsp;<input type="checkbox" title="模糊匹配" checked="checked"　name="chkBlur">模糊匹配 
                   </p>
                </TD>
            </TR>
</FORM>

<!--*********搜索工具条结束*****************-->	
		
		<TR>
            <TD>
<!--*************列表显示开始****************-->
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
<TR>
<TD>
    <TABLE class=border cellSpacing=1 cellPadding=2 width="100%" align=center border=0>
        <FORM name="hj_myform" action="nnmd_cableUInfo.jsp" method="post">
            <TBODY id=Tabs>
            <!--光缆管理列表表头开始-->
            <TR class=title align=middle height=2l2>
                <TD>流水号</TD>
				<TD>光缆编号</TD>
				<TD>光缆名称</TD>
                <TD>纤芯测试长度</TD>
				<TD>纤芯号</TD>
                <TD>纤芯使用情况</TD>
                <TD>数据更新时间</TD>
				<TD>备注</TD>
                <TD colspan="2"><p align="center">操作</p></TD>
            </TR>

            <!--光缆管理列表列表表头结束-->
  <!--基站地理环境管理记录开始-->
<%
		String strValues[] = new String[8];
		String idtmp;
		
        if (strbsSign == null || strbsSign.equals("0") || strFilter == null || strFilter.equals("")) {
            rs = mypage.myCableFQuery(request, response, 1, 10, stroccode);
        } else {
            rs = mypage.BlurFQuery(request, response, 1, 10, stroccode, strFilter);
        }
		
        while (rs.next()) {
            %>

            <TR class=tdbg onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" align=middle>

                <TD><%=rs.getString(1)%></TD>
                <TD><%=rs.getString(2)%></TD>
                <TD><%=rs.getString(3)%></TD>
                <TD><%=rs.getString(4)%></TD>
				<TD><%=rs.getString(5)%></TD>
				<TD><%=rs.getString(6)%></TD>
                <TD><%=rs.getDate(7)%></TD>
				<TD><%=rs.getString(8)%></TD>
                <TD align="center"><a href="javascript:tjsjx('<%=rs.getString(1)%>')">修改</a></TD>
                <TD align="center"><a href="javascript:tjsj('<%=rs.getString(1)%>')">删除</a></TD>
            </TR>

            <!--基站地理环境管理记录结束-->
 <%
 	 		idtmp = rs.getString(1);
			if(strsnid.equals(""))
	        {
    	        strsnid = rs.getString(1);
        	}
			if(strsnid.equalsIgnoreCase(idtmp))
			{
				for(int i = 0; i < 8; ++i)
				{
						strValues[i] = rs.getString(i+1);
				}
			}
        }
		String footer;
        if (strbsSign == null || strbsSign.equals("0") || strFilter == null || strFilter.equals(""))
			footer = mypage.PageFooter("ser_cableUInfo?seraction=sermodp&occode="+stroccode+"&filesnames="+jspName+"&");
		else
			footer = mypage.PageFooter("nnmd_cableUInfo.jsp?occode="+stroccode+"&txtFilter="+strFilter+"&bsSign=" + strbsSign + "&");
            %>

            <% 
			rs.close();
			mypage.dbConClose();
        %>
            <p align="left">
        </FORM>

        </p>

    </TD>
    </TR>
    <TR class=tdbg onMouseOver="this.className='tdbgmouseover'" onMouseOut="this.className='tdbg'" align=middle>
        <TD colspan="13">
            <p align="center">
            <div class="article-bottom">
                <div class="pages">
                    <%out.println(footer);%>
                </div>
            </div><!--article-bottom -->

          <!--content -->
            <!--mainWrapper -->
            <div id="footer">
                <div id="innerFooter"></div>
            </div>

        </TD>
    </TR>

    </TBODY>

</TABLE>
</TD></TR></TABLE>

<!--************列表显示结束****************-->
			</TD>
		</TR>		
        <TR>
            <TD>
                <TABLE class=border cellSpacing=1 cellPadding=2 width="101%" align="center" border="0">
                    <FORM name="Jz_myform" action="ser_cableUInfo" method="post">
                        <!--添加数据表单开始cs.jsp-->
                        <TBODY id=Tabs>
                            <TR class=tdbg>
                              <TD class=tdbg5 height="26">流水号</TD>
                              <TD height="26"><%=strValues[0]%><input type="hidden" name="T1" id="T12" size="20" maxlength="12" onBlur="checkQuote(this.value,this)" value="<%=strValues[0]%>"></TD>
                              <TD height="26" class=tdbg5>光缆编号:</TD>
                              <TD height="26"><%=stroccode%><input type="hidden" name="T1" id="sjidxid" size="20" maxlength="12" onBlur="checkQuote(this.value,this)" value="<%=stroccode%>"></TD>
                            </TR>
                            <TR class=tdbg>
                              <TD class=tdbg5 height="26">光缆名称：</TD>
                              <TD width="372" height="26"><%=strValues[2]%><input type="hidden" name="T1" id="ocname" size="20" maxlength="12" value="<%=strValues[2]%>"></TD>
							  <TD class=tdbg5 height="26"><p >纤芯测试长度：</p></TD>
                              <TD height="26"><input type="text" name="T1" size="20" maxlength="12" value="<%=strValues[3]%>"></TD>
                            </TR>		
                            <TR class=tdbg>
                                <TD class=tdbg5 height="26"><p >纤芯号：</p>
                                </TD>
                                <TD height="26"><input type="text" name="T1" size="20" maxlength="12" value="<%=strValues[4]%>"></TD>
                                <TD class=tdbg5 height="26"><p >纤芯使用状况：</p>
                                </TD>
                                <TD height="26"><input type="text" name="T1" size="20" maxlength="12" value="<%=strValues[5]%>"><input type="hidden" name="T1" value=""></TD>
                            </TR>
                            <TR class=tdbg>
                                <TD class=tdbg5 height="26"><p >备注：</p></TD>
                                <TD height="26" colspan="3"><textarea rows="7" name="T1" id="T2" cols="60" class=text2d onPropertyChange="textCounter(T2,64)"><%=strValues[7]%></textarea></TD>
							</TR>
                            <TR class=tdbg>
                                <TD class=tdbg5 height="51" colspan="4">
                                    <p align="center">
					  
                      <input type="hidden" name="filesnames" value=<%=jspName%>>
	 			  		<input type="hidden" name="seraction" value="sermod">
    	            <input type="hidden" name="txtoccode" id="occode" value="<%=stroccode%>">
	                <input type="hidden" name="txtocname" id="ocname" value="<%=strocname%>">				
					  　<input type="hidden" name="snid" id="snid" value="<%=strsnid%>">
					  　<input type="hidden" name="tToPage"  id="tToPage" value="<%=strToPage%>">						  

					  <input type="button" value="增加" name="btnInsert" style="width: 72; height: 25" class=tx_button onMouseOver="tst(this,'blue','#ffffff')" onMouseOut="tst(this,'black','#e8e7fe')" onClick="btnRinsertS();">
					  &nbsp;&nbsp;&nbsp;&nbsp;

                                    <input type="button" value="修改保存" name="JzB1" style="width: 72; height: 25" class=tx_button onMouseOver="tst(this,'blue','#ffffff')" onMouseOut="tst(this,'black','#e8e7fe')" onClick="btnModifyU();">
                                    &nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="reset" value="重置" name="JzB2" style="width: 72; height: 25" class=tx_button onMouseOver="tst(this,'blue','#ffffff')" onMouseOut="tst(this,'black','#e8e7fe')">
									&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="button" value="返回" name="JzB4" style="width: 72; height: 25" class=tx_button onMouseOver="tst(this,'blue','#ffffff')" onMouseOut="tst(this,'black','#e8e7fe')" onClick="btnReturn();">
                                </TD>
                            </TR>
					  </TBODY>
                    </FORM>
              </TABLE>
	<FORM name="frmReturn" action="/btsm/nnlist_cable.jsp" method="post" target="_parent">
	</FORM>					
</TD></TR></TBODY></TABLE>
</BODY></HTML>